
<script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/ueditor/ueditor.all.min.js"></script>
<!-- 编辑器公式插件 -->
<script type="text/javascript" charset="utf-8" src="/ueditor/kityformula-plugin/addKityFormulaDialog.js"></script>
<script type="text/javascript" charset="utf-8" src="/ueditor/kityformula-plugin/getKfContent.js"></script>
<script type="text/javascript" charset="utf-8" src="/ueditor/kityformula-plugin/defaultFilterFix.js"></script>
<script type="text/javascript" src="/My97DatePicker/WdatePicker.js"></script>
<style>
    #login-button{
        background: #286090!important;
        color: white!important;
        border: 1px solid #286090!important;
        border-radius: 3px;
    }
    .link-update{
        text-decoration: none;
    background: #337ab7;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: inline-block;
    }

</style>

<div class="span10">
    <div style="margin-bottom: 20px">
        <a href="/index/index">首页</a><span >&gt;</span><span>资讯管理</span><span >&gt;</span><span>添加/修改</span>
    </div>
    <form name="form" method="post" action="<?php echo baseUrl."/content/case/add"?>" enctype="multipart/form-data">
        <table>
            <tr>
                <td width="80px">标题 *:</td>
                <td><input type="text" name="name" placeholder="标题" style="width: 500px;" value="<?php echo isset($data)? $data['name']:''?>"></td>
            </tr>
            <?php if(isset($data)) {
                $str = '<tr>';
                $str .= '<td>原图:</td>';
                $str .= '<td>';
                $pic = $data['pic'];
                $str .= "<input name='pic' type='text' value='" . $pic . "'></td></tr>";
                echo $str;
            } ?>
            <tr>
                <td>成绩表截图*:</td>
                <td>
                    <input id="file" type="file" name="pic" >
                </td>
            </tr>
            <tr id="summary">
                <td>学员名字：</td>
                <td>
                    <input type="text" name="studentName" placeholder=""  style="width: 500px;" value="<?php echo isset($data)? $data['studentName']:''?>" />限200字内
                </td>
            </tr>
            <tr id="summary">
                <td>摘要：</td>
                <td>
                    <input type="text" name="summary" placeholder=""  style="width: 500px;" value="<?php echo isset($data)? $data['summary']:''?>" />限200字内
                </td>
            </tr>
            <tr>
                <td>所报班级：</td>
                <td>
                    <input type="text" name="class" placeholder=""  style="width: 500px;" value="<?php echo isset($data)? $data['class']:''?>" />限200字内
                </td>
            </tr>
            <tr>
                <td>学前成绩：</td>
                <td>
                    <input type="text" name="preScore[]" placeholder="听力"  style="width: 50px;" value="<?php echo isset($data['preScore'])? $data['preScore'][0]:''?>" />-<input type="text" name="preScore[]" placeholder="口语"  style="width: 50px;" value="<?php echo isset($data['preScore'])? $data['preScore'][1]:''?>" />-<input type="text" name="preScore[]" placeholder="阅读"  style="width: 50px;" value="<?php echo isset($data['preScore'])? $data['preScore'][2]:''?>" />-<input type="text" name="preScore[]" placeholder="写作"  style="width: 50px;" value="<?php echo isset($data['preScore'])? $data['preScore'][3]:''?>" />-<input type="text" name="preScore[]" placeholder="总分"  style="width: 50px;" value="<?php echo isset($data)? $data['preScore'][4]:''?>" />
                </td>
            </tr>
            <tr>
                <td>学后成绩：</td>
                <td>
                    <input type="text" name="afterScore[]" placeholder="听力"  style="width: 50px;" value="<?php echo isset($data['afterScore'])? $data['afterScore'][0]:''?>" />-<input type="text" name="afterScore[]" placeholder="口语"  style="width: 50px;" value="<?php echo isset($data['afterScore'])? $data['afterScore'][1]:''?>" />-<input type="text" name="afterScore[]" placeholder="阅读"  style="width: 50px;" value="<?php echo isset($data['afterScore'])? $data['afterScore'][2]:''?>" />-<input type="text" name="afterScore[]" placeholder="写作"  style="width: 50px;" value="<?php echo isset($data['afterScore'])? $data['afterScore'][3]:''?>" />-<input type="text" name="afterScore[]" placeholder="总分"  style="width: 50px;" value="<?php echo isset($data)? $data['afterScore'][4]:''?>" />
                </td>
            </tr>
            <tr>
                <td>学员反馈：</td>
                <td id="content">
                  <textarea style="width: 800px" id="editor" class="editor"
                             name="content"><?php echo isset($data)? $data['content']:''?></textarea>
                    <script>var editor = UE.getEditor('editor');</script>
                </td>
            </tr>

            <tr>
                <td>初始化点击量:</td>
                <td>
                    <input type="text" name="viewCount" placeholder=""  style="width: 500px;" value="<?php echo isset($data)? $data['viewCount']:''?>" />
                </td>
            </tr>
            <tr>
                <td>排序:</td>
                <td>
                    <input type="text" name="sort" value="<?php echo isset($data) ? $data['sort']:''?>"  />
                </td>
            </tr>

            <tr>
                <td>出分时间:</td>
                <td>
                    <input type="text" name="outTime" value="<?php echo isset($data) ? $data['outTime']:''?>"  />
                </td>

            </tr>
            <tr id="name"  >
                <td>上传：</td>
                <td>
                    <input type="text" name="author" placeholder=""  style="width: 500px;" value="<?php echo isset($data)? $data['author']:''?>" />
                </td>
            </tr>
            <tr>
                <td colspan="2" align="right">
                    <input type="hidden" name='id' value="<?php echo isset($data)? $data['id']:''?>"/>
                    <button type="submit" id="login-button">添加/修改</button>
                </td>
            </tr>
            <input type="hidden" name="_csrf" value="<?=Yii::$app->request->getCsrfToken()?>" />
        </table>
    </form>

</div>

<script type="text/javascript">
    $('.link-update').click(function(){
        var isTop = $(".isTop").val();
        if (isTop == "1") {
            $(".isTop").val("0");
            $(".link-update").text("置顶");
        } else {
            $(".isTop").val("1");
            $(".link-update").text("取消置顶");
        }
    })

</script>


